package com.yonyou.brigade.third_parties.didi.util;

import com.yonyou.brigade.third_parties.didi.model.DiDiUser;
import com.yonyou.ybzboot.uc.dto.UcUserDto;

/**
 * 工具类
 *
 * @author kangfw5
 * @since 2019-07-15
 */
public class DiDiUtil {

    /**
     * 用户中心用户转换为滴滴用户信息
     *
     * @param tenant    租户ID
     * @param ucUserDto 用户中心用户信息
     * @return {@link DiDiUser}
     */
    public static DiDiUser convertToDiDiUser(String tenant, UcUserDto ucUserDto) {
        DiDiUser diDiUser = new DiDiUser();

        diDiUser.setUserId(ucUserDto.getUserId());
        diDiUser.setEmail(ucUserDto.getEmail());
        diDiUser.setEmployeeNumber(ucUserDto.getPersonCode());
        diDiUser.setOrg(ucUserDto.getOrgPk());
        diDiUser.setTenant(tenant);
        diDiUser.setPhone(ucUserDto.getPhone());
        diDiUser.setRealname(ucUserDto.getUserName());

        return diDiUser;
    }
}
